#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]

#[cfg(unix)]
include!("./bindings.rs");

#[cfg(windows)]
include!("./windows.rs");


pub fn JS_DupValue(value:JSValue) -> JSValue {
    if value.tag < 0 {
        unsafe {
          let ptr = value.u.ptr as *mut JSRefCountHeader;
          let pref: &mut JSRefCountHeader = &mut *ptr;
          pref.ref_count += 1;
        }
      }
      value
}
//

/*

fn init_lib() {
    let mut cur_dir = String::from(env::current_dir().unwrap().to_str().unwrap());
    cur_dir.push_str("\\libquickjs.dll");
    let lib = Library::new(&cur_dir).expect("libquickjs.dll");
    let lib_info = LibraryInfo {
        lib,
        js_new_runtime: lib.get(b"JS_NewRuntime").unwrap(),
    };
}

#[test]
fn test_lib() {
    unsafe {
        
        let js_new_runtime:Symbol<unsafe extern fn() -> JSRuntime> = lib.get(b"JS_NewRuntime").unwrap();
        let rt = js_new_runtime();
        dbg!(rt);
    }
}*/